// 组件库的 vite.config.js
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [vue()],
    build: {
        lib: {
            entry: './src/index.js',
            name: 'SpiritEchoUI',
            fileName: (format) => `spiritechoui.${format}.js`
        },
        rollupOptions: {
            external: ['vue'],
            output: {
                globals: {
                    vue: 'Vue'
                }
            }
        },
        css: {
            extract: {
                filename: 'style.css', // 编译后样式文件名
            },
        },
        cssCodeSplit: false,

        minify: false
        // 可选：关闭压缩方便调试
    }
});